package com.sdu.shanyimisapi.exception;

import lombok.Data;

/**
 * @author lihaopeng
 * @version 1.0
 * @project shanyi-mis-api
 * @description 自定义异常类
 * @since 2024/4/13 11:31
 */
@Data
public class ShanyiMisException extends RuntimeException {
    private String msg;
    private int code = 500;

    public ShanyiMisException(Exception e) {
        super(e);
        this.msg = "执行异常";
        this.code = 500;
    }

    public ShanyiMisException(String msg) {
        super(msg);
        this.msg = msg;
    }

    public ShanyiMisException(String msg, Throwable e) {
        super(msg, e);
        this.msg = msg;
    }

    public ShanyiMisException(String msg, int code) {
        super(msg);
        this.msg = msg;
        this.code = code;
    }

    public ShanyiMisException(String msg, int code, Throwable e) {
        super(msg, e);
        this.msg = msg;
        this.code = code;
    }

}
